<?php

use yii\db\Migration;

/**
 * Handles the creation of table `carousel`.
 */
class m171123_032242_create_carousel_table extends Migration
{
    /**
     * @inheritdoc
     */
    public function up()
    {
        $this->createTable('carousel', [
            'id' => $this->primaryKey(),
            'name' => $this->string(20)->notNull()->comment('名字'),
            'img' => $this->string(255)->notNull()->comment('图片'),
            'link' => $this->string(255)->comment('链接'),
            'status' => $this->integer(11)->comment('状态 0关闭 1开启 '),
            'created_at' => $this->integer()->unsigned()->notNull()->comment('创建时间'),
            'updated_at' => $this->integer()->unsigned()->notNull()->comment('更新时间'),
        ]);
    }

    /**
     * @inheritdoc
     */
    public function down()
    {
        //$this->dropTable('carousel');
    }
}
